package com.just.sxmiaosha.controller;


import com.just.sxmiaosha.entity.Stock;
import com.just.sxmiaosha.service.StockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author just
 * @since 2020-09-23
 */
@RestController
@RequestMapping("/stock")
public class StockController {

    @Autowired
    private StockService stockService;

    @GetMapping("/getStockById")
    public Stock getStockById(int id) {
        return stockService.getStockById(id);
    }

    @GetMapping("/getStockCountById")
    public int getStockCountById(int id) {
        return stockService.getStockCountById(id);
    }

    @GetMapping("/getStockCountCache")
    public int getStockCountCache(int id) {
        return stockService.getStockCountCache(id);
    }
}
